const CreateUserRequest = {
    username: {
        type: "string",
        required: true,
        description: "用户账号",
        example: "admin",
        format: /^\w{3,20}$/,
    },
    password: {
        type: "string",
        required: true,
        description: "用户密码",
        example: "123456",
        format: /^[\w]{6,20}$/,
    },
    nickname: {
        type: "string",
        required: true,
        description: "用户昵称",
        example: "管理员",
        format: /^[\w\W]{2,20}$/,
    },
    rid: {
        type: "string",
        required: true,
        description: "用户身份",
        example: "DgLx-lE67-GrAd-jmpO",
        format: /^[\w\-]{19}$/,
    },
};

module.exports = {
    CreateUserRequest,
    UpdateUserRequest: {
        username: {
            ...CreateUserRequest.username,
            required: false,
        },
        password: {
            ...CreateUserRequest.password,
            required: false,
        },
        nickname: {
            ...CreateUserRequest.nickname,
            required: false,
        },
        rid: {
            ...CreateUserRequest.rid,
            required: false,
        },
    },
};
